<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>unhandledrejection</title>
</head>
<body>
    <p>unhandledrejection</p>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script>
        // window.addEventListener("unhandledrejection", event => {
        //     // 捕获 Promise 没有 catch 的错误
        //     console.info('unhandledrejection----', event)
        // })
        // Promise.reject('错误信息')
        // // .catch(e => console.info(e)) // catch 住了，就不会被 unhandledrejection 捕获
    </script>
</body>
</html>